<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">
	<script type="text/javascript">
		var im=["images/1.gif","images/2.gif","images/3.jpg","images/4.jpg","images/5.gif"];
		function danji(t){
			var v=t.innerHTML;
			var sr=document.getElementById("photo");
		    sr.setAttribute("src",im[(parseInt(v)-1)]);
//		    sr.src=im[(parseInt(v)-1)];
		}
	</script>
</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="danji(this)">1</a>
		<a href="#" onclick="danji(this)">2</a>
		<a href="#" onclick="danji(this)">3</a>
		<a href="#" onclick="danji(this)">4</a>
		<a href="#" onclick="danji(this)">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
</body>
</html>
